import apiHandle from '@/utils/request'
import {
  getAllCourseRes,
  createCourseReq,
  deleteCourseReq,
  updateCourseReq,
  getAllCourseReq,
  uploadFileReq,
  recordReq
} from './types'
export default {
  getAllCourse: apiHandle<getAllCourseReq, getAllCourseRes>({
    method: 'GET',
    url: 'api/course/list'
  }),
  createCourse: apiHandle<createCourseReq, null>({
    method: 'POST',
    url: 'api/course/add'
  }),
  deleteCourse: apiHandle<deleteCourseReq, null>({
    method: 'DELETE',
    url: 'api/course/remove'
  }),
  updateCourse: apiHandle<updateCourseReq, null>({
    method: 'PUT',
    url: 'api/course/update'
  }),
  uploadFile: apiHandle<uploadFileReq, null>({
    method: 'POST',
    url: 'api/file/upload'
  }),
  startRecord: apiHandle<recordReq, null>({
    method: 'GET',
    url: 'api/course/startLuZhi'
  }),
  stopRecord: apiHandle<recordReq, null>({
    method: 'GET',
    url: 'api/course/stopLuZhi'
  }),
  analyzeRecord: apiHandle<recordReq, null>({
    method: 'GET',
    url: 'api/course/fenXi'
  })
}
